package com.qst.medical.controller;

import com.github.pagehelper.PageInfo;
import com.qst.medical.domain.MedicalDrug;
import com.qst.medical.model.MedicalDrugModel;
import com.qst.medical.model.MedicalDrugQC;
import com.qst.medical.model.SSDto;
import com.qst.medical.service.MedicalDrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author: xwg
 * @CreateDate: 2023/9/4
 */

@RestController
@RequestMapping("/api/medical_drug")
public class MedicalDrugController {

    @Autowired
    private MedicalDrugService medicalDrugService;


    @PostMapping("/insert")
    public MedicalDrug insert(MedicalDrugModel medicalDrugModel) {
        return medicalDrugService.insert(medicalDrugModel);
    }

    //    多条件查询接口
    @PostMapping("/query")
    public PageInfo<MedicalDrug> query(@RequestBody MedicalDrugQC medicalDrugQC) {
        return medicalDrugService.query(medicalDrugQC);
    }

    @PostMapping("/ss")
    public List<SSDto> ss() {
        return medicalDrugService.ss();
    }

}
